package com.lancoo.znbkxx.teacher.utils;

import android.app.Application;


public class ToastUtils {
    //    private static Toast toast;
//    private static Application sContext;
    public static void init(Application application) {
//        sContext = application;
        CustomBlackToastStyle style = new CustomBlackToastStyle();
        com.hjq.toast.ToastUtils.init(application, style);
    }

    public static void showShort(CharSequence sequence) {
       /* if (toast == null) {
            toast = Toast.makeText(sContext, sequence, Toast.LENGTH_SHORT);
        } else {
            toast.setText(sequence);
            toast = Toast.makeText(sContext, sequence, Toast.LENGTH_SHORT);
            toast.setDuration(Toast.LENGTH_SHORT);
        }
        toast.show();*/
        com.hjq.toast.ToastUtils.show(sequence);
    }

    public static void showLong(CharSequence sequence) {
       /* if (toast == null) {
            toast = Toast.makeText(sContext, sequence, Toast.LENGTH_LONG);
        } else {
            toast.cancel();
            toast = Toast.makeText(sContext, sequence, Toast.LENGTH_LONG);
            toast.setDuration(Toast.LENGTH_LONG);
        }
        toast.show();*/
        com.hjq.toast.ToastUtils.show(sequence);
    }

//    public static Toast mToast;

    /**
     * 传入文字
     */
    public static void showToast(CharSequence text) {

       /* if (mToast == null) {
            mToast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
        } else {
            //如果当前Toast没有消失， 直接显示内容，不需要重新设置
            mToast.setText(text);
//            mToast.setDuration(Toast.LENGTH_SHORT);
        }
//        mToast.setGravity(Gravity., 0, 0);
        mToast.show();*/
        com.hjq.toast.ToastUtils.show(text);
    }


}

